package id.co.shuba.spamobile.model;

@Table("TBL_DSAR")
public class DSARInfo {		
	@PrimaryKey
	@Column("PROSPECT_ID")
	private String prospectID;
	
	@PrimaryKey
	@Column("VISIT_NO")
	private int visitNo;
	
	@FormField
	@Column("DATE_VISIT_PLAN")
	private String dateVisitPlan;
	
	@FormField
	@Column("DATE_VISIT_ACTUAL")
	private String dateVisitActual;
	
	@FormField
	@Column(value = "JOIN_FIELD_WORK", defaultValue = "Y")
	private String joinFieldWork;
	
	@FormField
	@Column("OBJECTIVE_OF_VISIT")	
	private String objectiveOfVisit;	
	
	@FormField
	@Column("RESULT_OF_VISIT")
	private String resultOfVisit;
	
	@FormField
	@Column("REMARK")
	private String remark;
	
	@Column("IS_UPLOAD")
	private String isUpload;
		
	@Column("ENTRY_BY")
	private String entryBy;
	
	@Column("ENTRY_DATE")
	private String entryDate;
	
	@Column("UPDATE_BY")
	private String updateBy;
	
	@Column("UPDATE_DATE")
	private String updateDate;	
	
	@Column("UPLOAD_BY")
	private String uploadBy;
	
	@Column("UPLOAD_DATE")
	private String uploadDate;	
	
	@Column("IS_DELETED")
	private String isDeleted;	

	@FormField
	private String timeVisitPlan;
	
	@FormField	
	private String timeVisitActual;
		
	public String getProspectID() {
		return prospectID;
	}
	public void setProspectID(String prospectID) {
		this.prospectID = prospectID;
	}
	public int getVisitNo() {
		return visitNo;
	}
	public void setVisitNo(int id) {
		this.visitNo = id;
	}
	public String getDateVisitPlan() {
		return dateVisitPlan;
	}
	public void setDateVisitPlan(String dateVisitPlan) {
		this.dateVisitPlan = dateVisitPlan;
	}
	public String getDateVisitActual() {
		return dateVisitActual;
	}
	public void setDateVisitActual(String dateVisitActual) {
		this.dateVisitActual = dateVisitActual;
	}
	public String getJoinFieldWork() {
		return joinFieldWork;
	}
	public void setJoinFieldWork(String joinFieldWork) {
		this.joinFieldWork = joinFieldWork;
	}
	public String getObjectiveOfVisit() {
		return objectiveOfVisit;
	}
	public void setObjectiveOfVisit(String objectiveOfVisit) {
		this.objectiveOfVisit = objectiveOfVisit;
	}
	public String getResultOfVisit() {
		return resultOfVisit;
	}
	public void setResultOfVisit(String resultOfVisit) {
		this.resultOfVisit = resultOfVisit;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}	
	public String getEntryBy() {
		return entryBy;
	}
	public void setEntryBy(String entryBy) {
		this.entryBy = entryBy;
	}
	public String getEntryDate() {
		return entryDate;
	}
	public void setEntryDate(String entryDate) {
		this.entryDate = entryDate;
	}
	public String getUpdateBy() {
		return updateBy;
	}
	public void setUpdateBy(String updateBy) {
		this.updateBy = updateBy;
	}
	public String getTimeVisitActual() {
		return timeVisitActual;
	}
	public void setTimeVisitActual(String timeVisitActual) {
		this.timeVisitActual = timeVisitActual;
	}
	public String getUpdateDate() {
		return updateDate;
	}
	public void setUpdateDate(String updateDate) {
		this.updateDate = updateDate;
	}
	public String getIsUpload() {
		return isUpload;
	}
	public void setIsUpload(String isUpload) {
		this.isUpload = isUpload;
	}
	public String getUploadBy() {
		return uploadBy;
	}
	public void setUploadBy(String uploadBy) {
		this.uploadBy = uploadBy;
	}
	public String getUploadDate() {
		return uploadDate;
	}
	public void setUploadDate(String uploadDate) {
		this.uploadDate = uploadDate;
	}
	public String getIsDeleted() {
		return isDeleted;
	}
	public void setIsDeleted(String isDeleted) {
		this.isDeleted = isDeleted;
	}	
	public String getTimeVisitPlan() {
		return timeVisitPlan;
	}
	public void setTimeVisitPlan(String timeVisitPlan) {
		this.timeVisitPlan = timeVisitPlan;
	}
	
	public void setVisitPlan(String strDate) {
		if (strDate == null || "".equals(strDate))
			return;
		
		try {
			String[] arr = strDate.split(" ");
			dateVisitPlan = arr[0];
			timeVisitPlan = arr[1].substring(0, 5);
		} catch (Exception e) {			
		}		
	}
	
	public void setVisitActual(String strDate) {
		if (strDate == null || "".equals(strDate))
			return;
		
		try {
			String[] arr = strDate.split(" ");
			dateVisitActual = arr[0];
			timeVisitActual = arr[1].substring(0, 5);
		} catch (Exception e) {			
		}
	}
	
	public String getFullVisitPlan() {
		return dateVisitPlan + " " + (timeVisitPlan != null && !"".equals(timeVisitPlan)? timeVisitPlan + ":00": "00:00:00");
	}	
	public String getFullVisitActual() {
		return dateVisitActual + " " + (timeVisitActual != null && !"".equals(timeVisitPlan)? timeVisitActual + ":00": "00:00:00");
	}

	public String temp;
}
